<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>

<!DOCTYPE html>
<html xmlns:c="http://java.sun.com/jsp/jstl/core">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>EAN Liste</title>
<link href="../../CSS/main.css" rel="stylesheet" type="text/css">
<link href="../../CSS/menu.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="../../JS/jquery.js"></script>
<script type="text/javascript"
	src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript" src="../../JS/UI.js"></script>
<script type="text/javascript" src="../../JS/errorhandler_startseite.js"></script>

<c:if test="${empty sessionScope.id}">
	<c:redirect url="../../index.jsp?error=3" />
</c:if>

</head>
<body>



	<div id="aussenwrapper">
		<div id="innenwrapper">

			<!-- HEADER -->
			<div id="header">
				<div id="logo">
					<img src="../../Image/Final.png" height="150" />
				</div>
			</div>

			<!--  Content-Bereich -->
			<div id="content">
				<jsp:include page="../sql_connect.jsp"></jsp:include>


				<sql:query dataSource="${exampleDS}"
					var="javax_servlet_jsp_jstl_sql_Result" maxRows="20" startRow="0"
					sql="SELECT `Name`, `EAN`, `Kategorie`, `Marke` FROM `lebensmittel`">
				</sql:query>

				<h2 style="text-align: center;">Übersicht</h2>

				<table id="remindertable">
					<tr>
						<c:forEach
							items="${javax_servlet_jsp_jstl_sql_Result.columnNames}"
							var="column">
							<th
								style="border: 1px solid #000000; padding: 5px; text-size: 150%; font-weight: bold; background-color: #3399FF;">${column}</th>
						</c:forEach>
					</tr>
					<c:forEach items="${javax_servlet_jsp_jstl_sql_Result.rows}"
						var="currRow">
						<tr>
							<c:forEach
								items="${javax_servlet_jsp_jstl_sql_Result.columnNames}"
								var="column">
								<td style="border: 1px solid #000000; padding: 5px;">${currRow[column]}</td>
							</c:forEach>
						</tr>
					</c:forEach>
				</table>
			</div>
			<!--Ende content-->

		</div>
		<!--Ende innenwrapper-->


	</div>
	<!--Ende aussenwrapper-->

	<div id="footer">
		<h2>INTELLIFRIDGE</h2>
	</div>
</body>
</html>